package com.zzxx.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zzxx.mapper.UserMapper;
import com.zzxx.pojo.UserInfo;
import com.zzxx.pojo.UserRole;
import com.zzxx.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public PageInfo<UserInfo> getAllUsers(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        PageInfo<UserInfo> pageInfo = new PageInfo<>(userMapper.queryAll());
        return pageInfo;
    }

    @Override
    public UserInfo findById(String id) {
        return userMapper.findById(id);
    }

}
